package model.sales;
// Generated Feb 14, 2013 10:33:00 PM by Hibernate Tools 3.2.1.GA


import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.Cascade;

/**
 * TrsSalespendingMst generated by hbm2java
 */
@Entity
@Table(name="trs_salespending_mst", schema="sales")
public class SalespendingMst  implements java.io.Serializable {

     private long id;
     private SalesInit salesInit;
     private Date transTime;
     private Integer memberId;
     private BigDecimal subtotal;
     private BigDecimal diskon;
     private BigDecimal ppn;
     private BigDecimal total;
     private String insertedLog;
     private List<SalespendingDetail> salespendingDetails;
     
    public SalespendingMst() {
    }

	
    public SalespendingMst(long id) {
        this.id = id;
    }
    
   
    @Id 
    @SequenceGenerator(name="salespending_seq", sequenceName="sales.trs_salespending_mst_id_seq", allocationSize=1)
    @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="salespending_seq")
    @Column(name="id", unique=true, nullable=false)
    public long getId() {
        return this.id;
    }
    
    public void setId(long id) {
        this.id = id;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="init_id")
    public SalesInit getSalesInit() {
        return this.salesInit;
    }
    
    public void setSalesInit(SalesInit salesInit) {
        this.salesInit = salesInit;
    }
    
    @Temporal(TemporalType.TIME)
    @Column(name="trans_time", length=15)
    public Date getTransTime() {
        return this.transTime;
    }
    
    public void setTransTime(Date transTime) {
        this.transTime = transTime;
    }
    
    
    @Column(name="member_id")
    public Integer getMemberId() {
        return this.memberId;
    }
    
    public void setMemberId(Integer memberId) {
        this.memberId = memberId;
    }
    
    @Column(name="subtotal", precision=13)
    public BigDecimal getSubtotal() {
        return this.subtotal;
    }
    
    public void setSubtotal(BigDecimal subtotal) {
        this.subtotal = subtotal;
    }
    
    @Column(name="diskon", precision=13)
    public BigDecimal getDiskon() {
        return this.diskon;
    }
    
    public void setDiskon(BigDecimal diskon) {
        this.diskon = diskon;
    }
    
    @Column(name="ppn", precision=13)
    public BigDecimal getPpn() {
        return this.ppn;
    }
    
    public void setPpn(BigDecimal ppn) {
        this.ppn = ppn;
    }
    
    @Column(name="total", precision=13)
    public BigDecimal getTotal() {
        return this.total;
    }
    
    public void setTotal(BigDecimal total) {
        this.total = total;
    }
    
    @Column(name="inserted_log", length=50)
    public String getInsertedLog() {
        return this.insertedLog;
    }
    
    public void setInsertedLog(String insertedLog) {
        this.insertedLog = insertedLog;
    }

    @OneToMany(cascade=CascadeType.ALL, fetch= FetchType.LAZY, mappedBy="salespendingMst")
    @Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
    @OrderBy("seq")
    public List<SalespendingDetail> getSalespendingDetails() {
        return salespendingDetails;
    }

    public void setSalespendingDetails(List<SalespendingDetail> salespendingDetails) {
        this.salespendingDetails = salespendingDetails;
    }
    




}


